#include "Main.h"
#include <iostream>
int queue[5]={0,0,0,0,0};
int x=0;
int y=0;
int printer = 0;
Class1::Class1(void)
{

}
Class1::~Class1(void)
{
}
void entqueue(int x){
	if(x>4){
		x=0;
	}
	queue[x]=rand()%100;
}
void dequeue(int y){
	if(y>4){
		y=0;
	}
	printer = queue[y];
	cout<<"The number that came out of the queue in slot "<<y<<"is: "<<printer<<"\n";
	queue[y]=0;
}
int main (void){
	int equeue = 0;
	int dqueue = 0;
	char generator = 'n';
	char printin = 'n';
	char programkill = 'n';
	bool dood =true;
	cout<<"This is the random queue generator"<<"\n";
		while(dood==true){
			cout<<"Generate a number?"<<"\n";
			cin >>generator;
			if(generator=='y'){
				entqueue(x);
				x++;
			}
			cout<<queue[0]<<" "<<queue[1]<<" "<<queue[2]<<" "<<queue[3]<<" "<<queue[4];
			cout<<"Would you like to print the number at the top of the queue?"<<"\n";
			cin >>printin;
				if(printin=='y'){
					dequeue(y);
					y++;
				}
			cout<<"Would you like to end the program?"<<"\n";
			cin >>programkill;
				if(programkill=='y'){
					dood=false;
				}
		}
	  cin.get();
	  return 0;
}
